package com.example.xpvideo.Controller;

import com.example.xpvideo.entity.PageResult;
import com.example.xpvideo.entity.ResponseResult;
import com.example.xpvideo.entity.req.PhpFeedbackReq;
import com.example.xpvideo.entity.req.PhpReportReq;
import com.example.xpvideo.entity.req.UpdateReq;
import com.example.xpvideo.entity.res.PhpFeedbackRes;
import com.example.xpvideo.entity.res.PhpReportRes;
import com.example.xpvideo.service.PhpFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;
import java.util.List;

@RestController
@RequestMapping("/back/feedback")
public class PhpFeedbackController {
    @Autowired
    private PhpFeedbackService phpFeedbackService;

    @GetMapping("/list")
    public ResponseResult<PageResult<List<PhpFeedbackRes>>> list(PhpFeedbackReq phpFeedbackReq)
            throws Exception{
        return phpFeedbackService.list(phpFeedbackReq);
    }

    @PostMapping("/delete")
    public ResponseResult<Object> delete(@RequestBody @NotNull UpdateReq updateReq) throws Exception{
        return phpFeedbackService.delete(updateReq);
    }
}
